class Hajime extends egret.Sprite{
	public constructor() {
		super();
		RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE,this.onGroupComplete,this);
		RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
        RES.loadConfig("resource/default.res.json","resource/");
        RES.loadGroup("loading");		
	}
	private  onGroupComplete(event: RES.ResourceEvent){

		if (event.groupName == "loading") {
            this.dispatchEvent(new LoadEvent(LoadEvent.LoadingLoad));
			RES.loadGroup("preload");	
        }
		else if (event.groupName == "preload") {
			// this.dispatchEvent(new LoadEvent(LoadEvent.ResourceLoad));
		}
		
	}
	private onResourceProgress(event:RES.ResourceEvent)
	{
		if(event.groupName == 'preload')
		{
			var arr=[event.itemsLoaded, event.itemsTotal]
			this.dispatchEvent(new LoadEvent(LoadEvent.LoadingProgress,arr,false,false));
		}
	}
}